const user = {
    state: {
        id: "",
        username: "",
        avatar: "",
        role: "admin",
        access: "",
        createTime: "",
    },
    getters: {
    },
    mutations: {
        setAccess(state, access) {
            state.access = access
            localStorage.setItem("access", access);
        },
        setUserInfo(state, userInfo) {
            state.id = userInfo.id;
            state.username = userInfo.username;
            state.avatar = userInfo.avatar;
            state.createTime = userInfo.createTime;
            localStorage.setItem("userInfo", JSON.stringify(userInfo));
        }
    },
    actions: {
    },
    modules: {
    }
}

export default user;